<div class="studentResumes search form">
<?php if(isset($searcher)): ?>
    <h2><?php  printf(__('Search Results with keyword: %s', true), $searcher); ?></h2>
<?php else: ?>
    <h2><?php  __('Search StudentResume'); ?></h2>
<?php endif; ?>

<!-- Search Box -->
<div class="searcher">
<?php echo $form->create('StudentResume', array('action'=>'search', 'method'=>'get'));?>
    <fieldset>
            <?php e($form->input('search', array(
                'class'=>'input text blur', 'label'=>false, 'value'=>'search resume',
                'title' =>'输入检索关键字, 如生产管理, 优秀学生, Office, 英语, 六级, 计算机, 二级')
            )); ?>
            <?php e($form->submit(__('Search Resumes', true), array('class'=>'submit', 'style'=>'clear:none'))); ?>
            <?php e($html->link(__('Advanced Options', true), 'javascript:void(0)', array('id'=>'a_toggle_options'))); ?>
            <div id="search_options">
                <p>Advanced search options</p>
            </div>
    </fieldset>
<?php echo $form->end();?>
</div>
<!-- Scripts for the search box -->
<script type="text/javascript">
jQuery(function(){
    $('#StudentResumeSearch').focus(function(){
        var input = $(this);
        if(input.hasClass('blur')){
            input.removeClass('blur')
                .addClass('focus')
                .attr('value', '');
        }
    });
    $('a#a_toggle_options').click(function(){
        $('div#search_options').toggle();
    }).click();
    $('#StudentResumeSearchForm').submit(function(event){
        var input = $('#StudentResumeSearch');
        if(input.val() == '' || input.val() == 'search resume'){
            event.preventDefault();
            $.sme.notify('warn', '请输入搜索关键字');
            input.focus();
        }
    });
    $('input#StudentResumeSearch').tooltip({
        position: 'center center',
        offset: [50, 0],
        tip: '#tooltip',
        lazy: false,
        effect: 'slide'
    }).dynamic({
        left: {
            direction: 'down',
            bounce: true
        }
    });
});
</script>

<!-- Search Results -->
<div class="results">
<?php if(isset($resumes)): ?>
    <!-- Print result status -->
    <div class="status">
        <p>
            <?php printf(__('Search for %s', true), $searcher); ?>,&nbsp;
            <?php printf(__('%d records are found', true), count($resumes)); ?>
        </p>
    </div>
    <!-- Print search results if we got some -->
    <?php if(count($resumes)): ?>
    <?php foreach($resumes as $i=>$resume): ?>
        <div class="item">
            <div class="student">
                <?php __('Student Name'); ?>:&nbsp;<?php e($resume['Student']['name']); ?>,&nbsp;
                <?php __('Number'); ?>:&nbsp;<?php e($resume['Student']['number']); ?>,&nbsp;
                <?php __('Phone'); ?>:&nbsp;<?php e($resume['Student']['phone']); ?>,&nbsp;
                <?php __('Gender'); ?>:&nbsp;<?php e($resume['Student']['gender']); ?>,&nbsp;
                <?php __('Political'); ?>:&nbsp;<?php e($resume['Student']['political']); ?>,&nbsp;
                <?php __('Province'); ?>:&nbsp;<?php e($resume['Student']['StudentProvince']['name']); ?>,&nbsp;
                <?php __('Minority'); ?>:&nbsp;<?php e($resume['Student']['StudentMinority']['name']); ?>
            </div>
            <div class="resume">
                <p><?php __('Intention'); ?>:&nbsp;<?php e($text->highlight(strip_tags($resume['StudentResume']['intention']), $searcher)); ?></p>
                <p><?php __('Awards'); ?>:&nbsp;<?php e($text->highlight(strip_tags($resume['StudentResume']['awards']), $searcher)); ?></p>
                <p><?php __('Abilities'); ?>:&nbsp;<?php e($text->highlight(strip_tags($resume['StudentResume']['ability']), $searcher)); ?></p>
                <p><?php __('Email'); ?>:&nbsp;<?php e($text->autoLinkEmails($resume['Student']['email'],
                    array('title'=> sprintf(__('Send email to: %s', true), $resume['Student']['name']), 'rev'=>'external'))); ?></p>
            </div>
        </div>
    <?php endforeach; ?>
    <?php endif; ?>
    <?php //debug(($resumes)); ?>
<?php else: ?>
    <p><?php __('You have not perform any search yet'); ?></p>
<?php endif; ?>
</div>

</div>